package sw.mylife.system;

import java.util.ArrayList;
import java.util.List;

import exception.PromptException;

public class Prompt {
	//Final statics
	public static final char TYPE_LOGIN_ERROR = 'e';
	
	//Attribute
	private char type;
	private List<String> textList = new ArrayList<String>();
	
	public char getType() {
		return type;
	}

	public void setType(char type) {
		this.type = type;
	}

	public List<String> getTextList(){
		return textList;
	}
	public String getText() throws PromptException{
		if(textList.size()>1){
			throw new PromptException();
		}else{
			return this.textList.get(0);
		}
	}

	public void setTextList(List<String> textList) {
		this.textList = textList;
	}

	//Methoden
	Prompt(char type, String text){
		this.type = type;
		textList.add(text);
	}
}
